﻿using System;
using System.Collections.Generic;
using Color = System.Drawing.Color;
using SwinGame;

namespace Gundam_2._0_Alpha.src
{
    public class AdjustParticles: CharacterAction
    {
        public enum Adjust
        {
            Add, Subtract
        }

        private Adjust a;

        public AdjustParticles(Character c, bool persistant, int row, int colEnd, int count, int lockoutLevel, Adjust a)
            :base(c, persistant, row, colEnd, count, lockoutLevel)
        {
            this.a = a;
        }

        public override void DoAction(GameController gc)
        {
            if (a == Adjust.Add)
                AddParticles();
            if (a == Adjust.Subtract)
                RemoveParticles();
        }

        private void RemoveParticles()
        {
            if ((c as Player).ParticleLevel == 1) return;
            (c as Player).ParticleLevel--;
            for (int i = 0; i < (c as Player).GnDriveParticles.Count; i++)
                (c as Player).GnDriveParticles[i].GNParticle.CurrentCell = (c as Player).ParticleLevel-1;            
            (c as Player).StatModifier.DamageMultiplier -= 1;
        }

        private void AddParticles()
        {
            if ((c as Player).ParticleLevel == 10) return;

            (c as Player).ParticleLevel++;
            for (int i = 0; i < (c as Player).GnDriveParticles.Count; i++)
                (c as Player).GnDriveParticles[i].GNParticle.CurrentCell = (c as Player).ParticleLevel-1;
            (c as Player).StatModifier.DamageMultiplier += 1;
        }

        public override void Reset(GameController gc)
        { }
    }
}
